import math
from decimal import *


x = .785398

for i in range (1000):
    getcontext().prec = 50
    x = Decimal(x) + Decimal\
        ((((math.cos(Decimal(x)))**2)*(1-math.tan(Decimal(x)))))

print (4*x)
